<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="../css/swiper.min.css">
	<style>
		
		.beijing{   
			position: fixed;
			top: 0;
			right: 0;
			left: 0;
			bottom: 0;
			background-color: #fff;
				
			opacity: 0.2;
			z-index: 999;
			display: none; 
		}
		.localing{
			width: 360px;
			height: 360px;
			background-image: url(./../img/018c8755b97d2b32f87528a1cf1d2b.gif);
			background-size: 100%;
			position: absolute;
			top: 50%;
			left: 50%;
			margin:-180px 0 0 -180px;
		}

		.swiper-slide{
			background-color: #00ee11;
			width: 500px;
			margin-top: 10px;
		}

	</style>
</head>
<body>

	<div class="beijing">
		<div class="localing"></div>
	</div>

	<div class="swiper-container">
	    <div class="swiper-wrapper">
		    <div class="swiper-slide">slider1</div>
		    <div class="swiper-slide">slider2</div>
		    <div class="swiper-slide">slider3</div>
		</div>
	</div>
	
	<script src='../lib/jquery-1.8.3.min.js'></script>
	<script src='../lib/swiper.min.js'></script>
	<script>

		
		var swiper = new Swiper('.swiper-container', {
	        pagination: '.swiper-pagination',
	        paginationClickable: true,
	        direction: 'vertical',
	        onTouchEnd: function(swiper){
			    if(swiper.translate>60){ //判断下拉刷新
                    loadNewData();// 加载更多数据
                }else if(swiper.translate<-40){ //判断上拉加载新数据
                            if(swiper.isEnd){//判断是否到达底部
                               loadNewData();// 加载更多数据
                            }
                        }
		    }

		});

		function loadNewData(){
   		  	$(".beijing").show();
   		  	swiper.appendSlide('<div class="swiper-slide">加入的内容</div>')
			$(".beijing").hide();
		}

	   


	</script>

</body>
</html>